﻿using com.iot.core.annotation;
using com.iot.core.data;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations; 

namespace com.iot.ht.Controllers.htsoft.data
{
    [Schema(Name = "监控软件表", Description = "")]     
    public class HtSoftApp : BaseEntity
    {
        [Comment("HostId")]
        [Schema(Name = "HostId", Description = "")] 
        [MaxLength(50)]
        public string HostId { get; set; } = "";


        [Comment("名称")]
        [Schema(Name = "名称", Description = "")]
        [Required(ErrorMessage = "{0}不能为空")]
        [MaxLength(50)]
        public string Name { get; set; } = "";

        [Comment("自动启动")]
        [Schema(Name = "自动启动", Description = "")] 
        public bool AutoStart { get; set; } 


        [Comment("启动类型")]
        [Schema(Name = "启动类型", Description = "exe  svr other")]
        [Required(ErrorMessage = "{0}不能为空")]
        [MaxLength(50)]
        public string Lx { get; set; } = "";//



        [Comment("启动信息")]
        [Schema(Name = "启动信息", Description = "")]        
        [MaxLength(200)]
        public string StartInfo { get; set; } = "";

        [Comment("启动参数")]
        [Schema(Name = "启动参数", Description = "")]
        [MaxLength(200)]
        public string StartArguments { get; set; } = "";


        [Comment("启动目录")]
        [Schema(Name = "启动目录", Description = "")]
        [MaxLength(200)]
        public string StartDir{ get; set; } = "";


        [Comment("启动等待")]
        [Schema(Name = "启动等待", Description = "启动等待毫秒")]
        [Required(ErrorMessage = "{0}不能为空")] 
        public int StartWaitMs { get; set; } = 2000;


        [Comment("检查方法")]
        [Schema(Name = "检查方法", Description = "http,sqlserver,redis,mysql")]
        [MaxLength(50)]
        public string CkMethod { get; set; } = "";

        [Comment("检查参数1")]
        [Schema(Name = "检查参数1", Description = "")]
        [MaxLength(400)]
        public string CkArg1 { get; set; } = "";

        [Comment("检查参数2")]
        [Schema(Name = "检查参数2", Description = "")]
        [MaxLength(400)]
        public string CkArg2 { get; set; } = "";


        [Comment("检查参数3")]
        [Schema(Name = "检查参数3", Description = "")]
        [MaxLength(400)]
        public string CkArg3 { get; set; } = "";


        [Comment("检查参数4")]
        [Schema(Name = "检查参数4", Description = "")]
        [MaxLength(400)]
        public string CkArg4 { get; set; } = "";


        [Comment("检查间隔")]
        [Schema(Name = "检查间隔", Description = "")]
        public int CkInterval { get; set; } = 10;


        [Comment("失败重启次数")]
        [Schema(Name = "失败重启次数", Description = "")]
        public int CkFailRestar { get; set; } = 3;



        [Comment("失败发送短信次数")]
        [Schema(Name = "失败发送短信次数", Description = "")]
        public int CkFailSms { get; set; } = 3;


        [Comment("排序号")]
        [Schema(Name = "排序号", Description = "")]
        public long Sortno { get; set; } = 3;
    }
}
